using System;
using NUnit.Framework;
using RunAllTestsInSolutionTask;
using System.Xml;

namespace RunAllTestsInSolutionTaskTests
{
    [TestFixture]
    //ctor is delgated to base class
    public class BaseProjectParserTests
    {
        protected const string NONE_EXISTANT_FILE = "NoSuchFile.csproj";
        protected const string NOT_XML_FILE = @"TestData\BadFormat.csproj";

        [Test]
        public void ctor_OnNoneXmlFile_ThrowsException()
        {
            Assert.Throws<XmlException>(() =>
                new ManagedProjectParser(NOT_XML_FILE));
        }

        [Test]
        public void ctor_GivenNoneExistantFile_ThrowsException()
        {
            Assert.Throws<ArgumentException>(() =>
                new ManagedProjectParser(NONE_EXISTANT_FILE));
        }

    }
}
